import request from '@/common/request'

export default {
  create(data) {
    //console.log(JSON.stringify(data));
    
    return new Promise((resolve, reject) => {
      request.post('/supervision/company', data).then(response => {
        resolve(response)
      })
    })
  },
  
  getList(map = {}) {
    return new Promise((resolve, reject) => {
      request.get('/supervision/company', map).then(response => {
        resolve(response)
      })
    })
  },
  
  getInfo(id, map = {}) {
    return new Promise((resolve, reject) => {
      request.get('/supervision/company/' + id, map).then(response => {
        resolve(response)
      })
    })
  },
  
  update(id, data) {
    console.log(JSON.stringify(data));
    return new Promise((resolve, reject) => {
      request.put('/supervision/company/' + id, data).then(response => {
        resolve(response)
      })
    })
  },
  
  delete(id) {
    return new Promise((resolve, reject) => {
      request.delete('/supervision/company/' + id).then(response => {
        resolve(response)
      })
    })
  }
}
